//Module_Blacklist mantiene los bans de los Ips agresivos. 
var fs = require('fs');
GLOBAL.banned = [''];

var input = fs.createReadStream('bannedips.txt');
readLines(input, func);
function readLines(input, func) {
  var remaining = '';

  input.on('data', function(data) {
    remaining += data;
    var index = remaining.indexOf(",");
    var last  = 0;
    while (index > -1) {
      var line = remaining.substring(last, index);
      last = index + 1;
      func(line);
      index = remaining.indexOf(",", last);
    }

    remaining = remaining.substring(last);
  });

  input.on('end', function() {
    if (remaining.length > 0) {
      func(remaining);
	
	}
  });

  }

function func(data) {
 // AGREGAR UN PUSH PARA EMPUJAR UN OBJETO AL STACK
	  banned.pop();
	  banned.push(data);
	}

exports.readLines = readLines;
exports.func = func;
